/**
 * Created by luojie on 2018/3/12.
 * 路由模块配置。
 */
import Bundle from "./bundle";

import PortalComp from "bundle-loader?lazy&name=app-[name]!./pages/portal";
import LoginComp from "bundle-loader?lazy&name=app-[name]!./pages/login";
import MyMemberComp from "bundle-loader?lazy&name=app-[name]!./pages/myMember";
import luckDrawComp from "bundle-loader?lazy&name=app-[name]!./pages/luckDraw";
import myGifts from "bundle-loader?lazy&name=app-[name]!./pages/myGifts";
import activityDetailComp from "bundle-loader?lazy&name=app-[name]!./pages/activityDetail";
import payPageComp from "bundle-loader?lazy&name=app-[name]!./pages/payPage";
import detailComp from "bundle-loader?lazy&name=app-[name]!./pages/detail";
import courseListComp from "bundle-loader?lazy&name=app-[name]!./pages/courseList";
import courseSiteComp from "bundle-loader?lazy&name=app-[name]!./pages/courseSite";


let arr = [
	{key:"Portal",comp:PortalComp},
	{key:"Login",comp:LoginComp},
	{key:"MyMember",comp:MyMemberComp},
	{key:"luckDraw",comp:luckDrawComp},
	{key:"myGifts",comp:myGifts},
	{key:"activityDetail",comp:activityDetailComp},
	{key:"courseList",comp:courseListComp},
	{key:"payPage",comp:payPageComp},
	{key:"detail",comp:detailComp},
	{key:"courseSite",comp:courseSiteComp},
];

const Modules = {};
arr.forEach((item)=>{
	Modules[item.key] = (props)=>(
		<Bundle  load={item.comp}>
			{(Comps) => <Comps {...props} />}
		</Bundle>
	)
});

export default Modules